<?php 
		$wall_post = $this->wall_post;
		$info_username = $this->info_username;
		$info_viewer = $this->info_viewer;
		$list_friend = $this->list_friend;
?>
<div class="wall">
	<div id="wall_post">
		<ul>
        	<li><a href="#status"><span>Status</span></a></li>
        	<li><a href="#photo"><span>Photo</span></a></li>
    	</ul>
    	<div id="status">
    		<form method=POST action="/<?php echo $info_username['username']?>/wall/add">
    			<textarea cols="60" name="content"></textarea>
    			<input name="type" value="1" style="display:none" />
    			<input type=submit class='login_button' value='POST' />
    		</form>
    	</div>
    	<div id="photo">
    		<form method=POST action="/<?php echo $info_username['username']?>/wall/add">
    			<center>
    			<input type=file id="photo_upload" name="photo_upload" />
    			<input name="photo" id="photo2" style="display:none" value="" /><br />
				<div id="show_photo" align=center></div>
    			<input name="type" value="2" style="display:none" />
    			<input type=submit class='login_button' value='POST' />
    			</center>
    		</form>
    	</div>
    </div>
    <hr style='color:white' />
    <div class="list_wall">
    	<?php foreach ($wall_post as $status){?>
    		<div class="status_box" style="background-image:url('/images/box2.png');width:100%;">
    				<table width=470px>
    					<tr>
    						<td width=100px height=100px align=center>
    							<?php 
    								$img_path = IMAGE_PATH.'/avatar/'.$status['avatar'];
    								$size = getimagesize($img_path);
    								if ($size[0]>$size[1]) $att='width';
    								else $att = 'height';
    							?>
    							<div style="background-image:url('/images/round.png')">
    								<img src='/images/avatar/<?php echo $status['avatar']?>' <?php echo $att?>=100px />
    							</div>
    						</td>
    						<td valign=top>
    							<div style="margin-left:10px">
    								<div style=''>
    									<table width=100%>
    										<tr>
    											<td>
    												<a href='/<?php echo $status['username']?>/wall' style="text-decoration:none;color:#FF6600;font-size:15px;font-family:Georgia,serif"><b><?php echo $status['fullname']?></b></a>
    											</td>
    										</tr>
    									</table>
    								</div>
    								<?php if ($status['type']==1){?>
    								<span style="font-size:15px"><i><?php echo $status['content']?></i></span>
									<?php }else{?>
									<center>
										<img src="<?php echo $status['photo']?>" height=75px />
									</center>
									<?php }?>
									<a href="/<?php echo $this->info_username['username']?>/comment/index/?id=<?php echo $status['wall_id']?>" style="text-decoration:none"><div style="color:white;background:orange;padding: 3px"><b>View comments</b></div></a>
    							</div>
    						</td>
    					</tr>
    				</table>
    		</div>
    	<?php }?>
    </div>
</div>
<?php if ($info_username['id']==$info_viewer['id']){?>
<div class="list_request">
	<div style="margin-top:2px;width:100%;color:#ff6600" align=center>
		Friend request
	</div>
    
    <?php 
		$list_request = $this->list_request;
		foreach ($list_request as $request){
	?>
		<div class="request_box" align=center>
			<table width=100px>
			<tr>
				<td height=100px style="background-image:url('/images/round.png')">
				<?php 
					$img_path = IMAGE_PATH.'/avatar/'.$request['avatar'];
    				$size = getimagesize($img_path);
    				if ($size[0]>$size[1]) $att='width';
    				else $att = 'height';
				?>
				<center><img src='/images/avatar/<?php echo $request['avatar']?>' <?php echo $att?>=100px /></center>
				</td>
			</tr>
			<tr>
				<td>
					<center><a href="/<?php echo $request['username']?>" style="color:orange;text-decoration:none"><b><?php echo $request['fullname']?></b></a></center>
				</td>
			</tr>
			<tr>
				<td>
					<div id="request_result_<?php echo $request['id']?>" style="font-family:arial;font-size:12px" align=center>
						<button class="login_button" onclick="acceptfriend(<?php echo $request['id']?>)">accept</button>
						<button class="login_button" onclick="refusefriend(<?php echo $request['id']?>)">refuse</button>
					</div>
				</td>
			</tr>
			</table>
		</div>
	<?php 
		}
	?>
</div>
<?php }?>